home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 May / PCPlus May 1998=disk A.iso / trial / gdldb / disk1 / data1.cab / Example_Files / graphs.scp < prev    next >
Encoding:
Text File  |  1998-01-21  |  1.2 KB  |  55 lines

  1. ##########################################################
  2. # GDIdB demo script (c) 1997 Global Data Industries
  3. #
  4. # This example shows how a simple graph can be included
  5. # on a web page. The graph can be drawn using small "gif"
  6. # block images, or even just text characters. The data for
  7. # the graph is here generated by the script, but could just
  8. # as easily come from a database.
  9. ##########################################################
  10.  
  11.  
  12.  
  13.  
  14.  
  15. ##########################################################
  16. # declare variables used in script
  17.  
  18. &defvar(?count?,?function?)
  19.  
  20.  
  21.  
  22.  
  23.  
  24. ##########################################################
  25. # Print the information screen
  26.  
  27. &cls
  28. &print("Graphs Demo Script")
  29. &print("-----------------------------------")
  30.  
  31.  
  32.  
  33.  
  34.  
  35. ##########################################################
  36. # generate the html
  37.  
  38. &html("index.html")
  39. {
  40.     <HTML>
  41.     <HEAD>
  42.     <TITLE>Graph of X Squared</TITLE>
  43.     </HEAD>
  44.     <BODY>
  45.     <H1>Graph showing function X Squared</H1>
  46.     &for(?count?,0,?count?<12,1)
  47.     {
  48.         # calculate X Squared.
  49.         &assign(?function?,?count?*?count?)
  50.         <NOBR>&repeat(?function?){<IMG SRC=\"graph.gif\">}</NOBR><BR>
  51.     }
  52.     </BODY>
  53.     </HTML>
  54. }
  55.